<template>
  <div class="player-cover" v-if="nowSong.name">
    <div class="player-cover-left">
      <img :src="nowSong.pic" alt="" />
      <i @click="openLyric" class="iconfont icon-zuidahua"></i>
    </div>
    <div class="player-cover-right">
      <div class="player-cover-right-title">{{ nowSong.name }}</div>
      <div class="player-cover-right-artist">{{ nowSong.arist }}</div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['nowSong'],
  beforeMount () {
    console.log(this.nowSong)
  },
  methods: {
    openLyric () {
      //打开歌词
      this.$emit('openlyric')
    }
  }
}
</script>
<style lang="less">
.player-cover {
  width: 18%;
  height: 100%;
  position: absolute;
  background: skyblue;
  top: -100%;
  display: flex;
  left: 0;
  &-left {
    padding: 0px 10px 0px 5px;
    height: 60px;
    width: 80px;
    margin-right: 10px;
    position: relative;
    margin-left: 20px;
    img {
      width: 60px;
      height: 50px;
      text-align: center;
      position: absolute;
      left: 0;
      top: 0;
    }
    i {
      width: 60px;
      height: 50px;
      font-size: 40px;
      color: white;
      text-align: center;
      line-height: 60px;
      position: absolute;
      top: 0;
      left: 0;
      background: rgba(0, 0, 0, 0.5);
      display: none;
    }
    &:hover {
      i {
        display: block;
      }
    }
  }
  &-right {
    flex: 1;
    font-size: 13px;
    padding: 0px 10px;
    position: relative;
    &-title {
      font-weight: 600;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 1;
      overflow: hidden;
    }
    &-artist {
      position: absolute;
      bottom: 0px;
    }
  }
}
</style>
